cc.Class({
    extends: cc.Component,

    properties: {
        username:{
            default:null,
            type:cc.Label
        },
        cards: {
            default: null,
            type: cc.Label
        },
        showid: {
            default: null,
            type: cc.Label
        },
        logo: {
            default: null,
            type: cc.Sprite
        }
    },

    onLoad: function () {
        this.username.string = cc.beimi.user.username;
        this.cards.string = cc.beimi.user.cards;
        this.showid.string = cc.beimi.user.id.slice(0,6);
        var remoteUrl = cc.beimi.logo;
        let self = this;
        if(remoteUrl){
            cc.loader.load({url: remoteUrl, type: 'png'}, function (err,tex) {
                var spriteFrame = new cc.SpriteFrame(tex, cc.Rect(0, 0, 132, 132));
                self.logo.spriteFrame = spriteFrame;
            });
        }
    }
});